package org.fuyd.designpattern.singleton;

/**
 * 懒汉模式，在多线程下，正常工作，效率低
 * Created by Jason on 2015/10/22.
 */
public class Singleton2 {

    private static Singleton2 instance;

    private Singleton2() {

    }

    public static synchronized Singleton2 getInstance() {
        if (instance == null) {
            instance = new Singleton2();
        }
        return instance;
    }
}
